﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="UserSingleSearch.ascx.cs" Inherits="NetDon.OA.Portal.Components.UserSingleSearch" %>
<%@ Register TagPrefix="ucc" TagName="ReMark_1_1" Src="~/Controls/RequiredMark.ascx" %>
<script type="text/javascript" src="../Javascripts/json2.js"></script>
<script language="javascript" type="text/javascript">

    function ChooseUserSingle() {
        $dialog('<%= ResolveUrl("~/Components/UserSearchPopup.aspx?Mode=Single") %>', { width: 780, height: window.top.$common.getClientBounds().height - 100 }, function (result) {
            if (result) {

                var users = JSON.parse(result);

                if (!$array(users)) return;
                if ($array(users).length <= 0) return;
                var i = 0;
                Array.forEach($array(users), function (user) {

                    if (i++ == 0) {

                        $text($get('<%=this.txtUserNameSingle.ClientID %>'), user.FullName);
                        $text($get('<%=this.txtUserIdSingle.ClientID %>'), user.UserId);

                    }

                })
               
            }
        });
        return false;
    }
</script>
<asp:TextBox runat="server" ID="txtUserNameSingle" MaxLength="50" Width="80px"></asp:TextBox>
<asp:HiddenField ID="txtUserIdSingle" runat="server" />
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtUserNameSingle"
    Display="None" ErrorMessage="请选择用户！" SetFocusOnError="True"></asp:RequiredFieldValidator>
<ucc:ReMark_1_1 ID="RequiredMark1" runat="server" />
<asp:ImageButton ID="ImageButtonSearch" runat="server" SkinID="SelectUser" CausesValidation="false"
    OnClientClick="return ChooseUserSingle();" />

